#include <stdlib.h>

#define ROW_MAJOR(row, col, ld) ((row) * (ld) + (col))

void random_matrix(int m, int n, float *a) {
//  double drand48();
  int i, j;

  for (i = 0; i < m; i++)
    for (j = 0; j < n; j++)
      a[ROW_MAJOR(i, j, n)] = 2.0 * drand48() - 1.0;
      // a[ROW_MAJOR(i, j, n)] = (j - i) % 3;
      // a[ROW_MAJOR(i, j, n)] = 1;
}
